home *** CD-ROM | disk | FTP | other *** search
- Path: sn.no!orjarive
- From: jakob.rivertz@aftenposten.no (Jakob Rivertz)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Strange guru
- Date: Thu, 29 Feb 96 06:52:34 GMT
- Organization: Aftenposten A/S
- Message-ID: <4h3ivo$966@hasle.sn.no>
- References: <4gscv0$ovd@brachio.zrz.TU-Berlin.DE>
- NNTP-Posting-Host: gatekeeper.aftenposten.no
- X-Newsreader: News Xpress 2.0 Beta #0
-
- In article <4gscv0$ovd@brachio.zrz.TU-Berlin.DE>,
- rawneiha@hydra.zrz.TU-Berlin.DE (Philipp Boerker) wrote:
- >
- >My amiga is constantly surprising me with a strange guru:
- >
- >I did some coding, the code crashes when exiting with guru $87000004
- >which translates as "did not expect a packet (dos.library)".
- >
- > But that's not all:
- >whenever I start it via shell or Arexx/DosCommand it does not crash,
- >whenever I start it via doubleclick on the icon it does!
-
- [As I have not programmed an Amiga in two years, this answere may
- no longer be valid.] I did see this error when I was writing some
- programs and attempted to use the process->pr_MsgPort field for
- general message communication (don't mess with it, it is actually
- reserved for WB/dos).
-
- This guru is generated when a dos.library function is called, and
- it senses a packet in the process->pr_MsgPort list when no message
- was expected. Remember that dos.library uses a simple master/slave
- scheme, ie. a dos function call generates a packet to a handler,
- and the handler returns a reply. It confuses dos to see something
- that looks like a reply, before a request has been sent. The amiga
- is good, but it's not a mind-reader. Yet! ;-).
-
- I would assume that dos.library locates the WB Startup message in
- the process->pr_MsgPort list. This message is only sent when WB
- starts the program, never when the program is started from a CLI.
-
- Do a GetMsg() on process->pr_MsgPort when your program starts. If
- it returns non-NULL, then hold onto this message until your code can
- exit. Then reply the message. WB will then UnLoadSeg() your code.
- Actually the standard C startup code should do this for you, but for
- some reason or other it doesn't. You do link with the C startup code?
-
- --
- Jakob <jakob.rivertz@aftenposten.no>
-